
// stdafx.cpp : source file that includes just the standard includes
// zego_instantTalk_demo.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"
#include <stdarg.h>


std::wstring AnsiToUnicode(const char* str)
{
	if (!str || !*str) return L"";

	DWORD dwNum = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
	wchar_t *pwText;
	pwText = new wchar_t[dwNum];
	if (!pwText) {
		delete[]pwText;
	}
	MultiByteToWideChar(CP_ACP, 0, str, -1, pwText, dwNum);
	std::wstring wstrTmp(pwText);
	delete[]pwText;
	return wstrTmp;
}

void _Log( WCHAR *pszformat ...)
{
	va_list argList;
	va_start(argList, pszformat);

	WCHAR buf[512];
	_vsntprintf_s(buf, 512, _TRUNCATE, pszformat, argList);

	OutputDebugString(buf);
	OutputDebugString(L"\n");

	va_end(argList);
}

void _Alog( char *pszformat ...)
{
	va_list argList;
	va_start(argList, pszformat);

	char buf[512];
	_vsnprintf_s(buf, 512, _TRUNCATE, pszformat, argList);

	OutputDebugStringA(buf);
	OutputDebugStringA("\n");

	va_end(argList);
}
